package n1321;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {

	static int[][] chess=new int[8][8];
	
	static int n,k;
	
	static int count=0;
	
	static void dfs(int m,int last)
	{
		if(m==k+1)
		{
			count++;
			return;
		}
		
		
		for(int i=last;i<n;i++)
			for(int j=0;j<n;j++)
			{
				if(isok(i,j,m))
				{
					for(int p=0;p<n;p++)
					{
						chess[i][p]++;
						chess[p][j]++;
					}
					dfs(m+1,i+1);
					for(int p=0;p<n;p++)
					{
						chess[i][p]--;
						chess[p][j]--;
					}
				}
			}
	}
	
	static void dfs2(int m, int k)
	{
		if(k==0)
		{
			count++;
			return;
		}
		
		if(m>=n)return;
		
		for(int i=0;i<n;i++)
		{
			if(chess[m][i]==0)
			{
				for(int p=0;p<n;p++)
				{
					chess[m][p]++;
					chess[p][i]++;
				}
				dfs2(m+1,k-1);
				for(int p=0;p<n;p++)
				{
					chess[m][p]--;
					chess[p][i]--;
				}
			}
		}
		dfs2(m+1,k);
	}
	
	static boolean isok(int x,int y,int m)
	{
		if(chess[x][y]!=0)return false;
		return true;
	}
	
	
	/**
	 * @param args
	 */
	public static void main(String[] args) throws Exception {
		// TODO Auto-generated method stub

		BufferedReader bf=new BufferedReader(new InputStreamReader(System.in));
		
		String line=null;
		
		while((line=bf.readLine())!=null)
		{
			StringTokenizer st=new StringTokenizer(line);
			n=Integer.parseInt(st.nextToken());
			k=Integer.parseInt(st.nextToken());
			count=0;
			if(n==-1&&k==-1)break;
			for(int i=0;i<n;i++)
			{
				line=bf.readLine();
				for(int j=0;j<n;j++)
				{
					if(line.charAt(j)=='#')
					{
						chess[i][j]=0;
					}else {
						chess[i][j]=1;
					}
				}
			}
			dfs2(0,k);
			System.out.println(count);
		}
	}

}
